var express = require('express');
var bodyParser = require('body-parser')
var config = require("./config.json")
var app = express();
import createMiddleware from './dev/createMiddleware';

app.use(bodyParser.urlencoded({extended:false}));
app.use(bodyParser.json());

createMiddleware().then((data) => {
	const middleware = data.middleware;
	
	app.use(middleware);

	app.listen(config.listen_port, function () {
	  console.log(`mock-server listening on port ${config.listen_port}!`);
	});	
})

